<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <style>
        body{
            color:grey;
        }
        /*（2,2，0）*/
        #shop .favorite:not(#shop) .highlight{
            color:red;
        }
        /*（1，3，0）*/
        #shop .highlight:nth-of-type(1):nth-last-of-type(1){
            color:blue;
        }
    </style>
        <ul class="shopping-list" id="shop">
            <li><span>Milk</span></li>
            <li class="favorite" id="must-buy">
                <span class="highlight">Sausage</span>
            </li>
        </ul>

</body>
</html>